package com.darwin.darwinUI.manager
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	/**
	 * 场景面板管理器。ScenePanel在UI层之下场景之上
	 * @author lipi
	 */
	public class ScenePanelManager extends EventDispatcher
	{
		public function ScenePanelManager(target:IEventDispatcher=null)
		{
			super(target);
		}
		
		
		private var _parent:DisplayObjectContainer;
		
		public function get parent():DisplayObjectContainer
		{
			return _parent || UIStage.uiStage;
		}
		
		public function set parent(value:DisplayObjectContainer):void
		{
			_parent = value;
		}
		
		
		public function addPanel(panel:DisplayObject):void
		{
			parent.addChild(panel);
		}
		
		public function removePanel(panel:DisplayObject):void
		{
			parent.removeChild(panel);
		}
		
	}
}